Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.java.swing.ImageIcon
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Field Summary | |
static java.awt.Component | component
|
static java.awt.MediaTracker | tracker
|
Constructor Summary | |
ImageIcon(java.lang.String filename,
java.lang.String description)
Creates an ImageIcon from the specified file. |
|
ImageIcon(java.lang.String filename)
Creates an ImageIcon from the specified file. |
|
ImageIcon(java.net.URL location,
java.lang.String description)
Creates an ImageIcon from the specified URL. The image will be preloaded by using MediaTracker to monitor the loaded state of the image. |
|
ImageIcon(java.net.URL location)
Creates an ImageIcon from the specified URL. The image will be preloaded by using MediaTracker to monitor the loaded state of the image. |
|
ImageIcon(java.awt.Image image,
java.lang.String description)
Creates an ImageIcon from the image. |
|
ImageIcon(java.awt.Image image)
Creates an ImageIcon from the image. |
|
ImageIcon(byte[] imageData,
java.lang.String description)
Creates an ImageIcon from an array of bytes which were read from an image file containing a supported image format, such as GIF or JPEG. Normally this array is created by reading an image using Class.getResourceAsStream(), but the byte array may also be statically stored in a class. |
|
ImageIcon(byte[] imageData)
Creates an ImageIcon from an array of bytes which were read from an image file containing a supported image format, such as GIF or JPEG. Normally this array is created by reading an image using Class.getResourceAsStream(), but the byte array may also be statically stored in a class. |
|
ImageIcon()
Creates an uninitialized image icon. |
Method Summary | |
java.lang.String | getDescription()
Get the description of the image. |
int | getIconHeight()
Get the height of the Icon |
int | getIconWidth()
Get the width of the Icon |
java.awt.Image | getImage()
Returns the Icon's Image |
int | getImageLoadStatus()
Returns the status of the image loading operation. |
java.awt.image.ImageObserver | getImageObserver()
Return the umage observer for the image |
void | loadImage(java.awt.Image image)
Wait for the image to load |
void | paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
Paints the Icon |
void | setDescription(java.lang.String description)
Set the description of the image. |
void | setImage(java.awt.Image image)
Set the image displayed by this icon. |
void | setImageObserver(java.awt.image.ImageObserver observer)
Set the image observer for the image. |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
protected static final java.awt.Component component
protected static final java.awt.MediaTracker tracker
Constructor Detail |
public ImageIcon(java.lang.String filename, java.lang.String description)
filename
- the name of the file containing the image
description
- a brief textual description of the imagepublic ImageIcon(java.lang.String filename)
public ImageIcon(java.net.URL location, java.lang.String description)
URL
- the URL for the image
description
- a brief textual description of the imagepublic ImageIcon(java.net.URL location)
public ImageIcon(java.awt.Image image, java.lang.String description)
image
- the image
description
- a brief textual description of the imagepublic ImageIcon(java.awt.Image image)
public ImageIcon(byte[] imageData, java.lang.String description)
imageData
- an array of pixels in an image format supported
by the AWT Toolkit, such as GIF or JPEG.
description
- a brief textual description of the imagepublic ImageIcon(byte[] imageData)
an
- array of pixels in an image format supported by
the AWT Toolkit, such as GIF or JPEG.public ImageIcon()
Method Detail |
protected void loadImage(java.awt.Image image)
public int getImageLoadStatus()
public java.awt.Image getImage()
public void setImage(java.awt.Image image)
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
public int getIconWidth()
public int getIconHeight()
public void setImageObserver(java.awt.image.ImageObserver observer)
icon = new ImageIcon(...) button.setImage(icon); icon.setImageObserver(button);
public java.awt.image.ImageObserver getImageObserver()
Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |